/*
弹窗页面函数库
黄
2017.03.10
*/
!function(){
	//ajax的iframe操作
	$('[data-ajax="ajax-iframe"]').on('click',function(e){
		e.preventDefault();
		//生成元素
		var that = this;
		var href = $(that).attr('href');
		//看是否全屏
		var full = $(that).attr('data-full');
		full = 1 == full?full:0;
		//获取宽度高度
		var w = $(that).attr('data-w');
		var h = $(that).attr('data-h');
		w = full?'100%':w?w+'px':'auto';
		h = full?'100%':h?h+'px':'auto';
		layer.open({
				type: 2,
				title:that.title,
				shadeClose:false,
				shade: 0.8,
				shift:2,
				area: [w, h],
				btn: ['确定', '取消'],
				content: href, //dom
				yes: function(index, layero){
    				var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
    				iframeWin.call_submit(index);
				}
		});	
	});
}();